import java.sql.*;

public class App {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {

        Class.forName("com.mysql.jdbc.Driver");
        String url ="jdbc:mysql://localhost:3306/test?useSSL=false";
        String username="root";
        String password="yangxiaocheng3";
        Connection connection = DriverManager.getConnection(url, username, password);
        Statement statement = connection.createStatement();
        ResultSet set = statement.executeQuery("SELECT version()");
        set.next();
        String string = set.getString(1);
        System.out.println(string);
        connection.close();
    }
}
